<?php

class RoundDao extends BaseDao {
	
	public function __construct($dsn, $username, $password) {
		parent::__construct($dsn, $username, $password);
			
		$this->mapping = new Mapping("RoundModel", "t_round", array("id"),
		array(
			'id',	
			'name',	
			'start',	
			'end',	
			'ticks',	
			'tickTime',	
			'currentTick',	
			'current'
		),
		array(
			'id',	
			'name',	
			'start',	
			'end',	
			'ticks',	
			'tickTime',	
			'currentTick',	
			'current'
		));
	}
	
	public function current() {
		$criteria = array("current" => true);
		$arr = $this->query($criteria);
		return $arr ? $arr[0] : null;	
	}
}
?>